



from selenium import webdriver
import time

from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.maximize_window()
driver.implicitly_wait(5)
# driver.get("https://www.baidu.com/s?ie=UTF-8&wd=%E8%87%AA%E5%8A%A8%E5%8C%96")
driver.get("https://www.glp.com.cn/")
time.sleep(3)
# 将滚动条向下拖动到某个位置
# js="var q=document.documentElement.scrollTop=50000000000"
# driver.execute_script(js)
# time.sleep(5)
element = driver.find_element(By.XPATH,'//div[@class="footer"]')
driver.execute_script("arguments[0].scrollIntoView();", element)
time.sleep(3)
# # 将滚动条拖动到最顶部
# js0 = 'var action=document.documentElement.scrollTop=0'
# driver.execute_script(js0)
# time.sleep(3)
# driver.quit()